package com.ichina.chat.dao;

import java.util.Date;
import java.util.List;

import com.ichina.chat.util.Page;
import com.ichina.chat.vo.Reply;

public interface ReplyDao 
{
	/**
	 * 增加一条记录
	 * @param r
	 * @throws Exception
	 */
	public void addReply(Reply r) throws Exception;
	
	/**
	 * 根据客服ID删除
	 * @param sid
	 * @throws Exception
	 */
	public void deleteReplyBySid(int sid) throws Exception;
	
	/**
	 * 查询所有回答带分页
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Reply> queryReplyAll(Page page) throws Exception;
	
	/**
	 * 根据客服ID查询带分页
	 * @param sid
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Reply> queryReplyBySid(int sid,Page page) throws Exception;
	
	/**
	 * 根据时间查询带分页
	 * @param time
	 * @return
	 * @throws Exception
	 */
	public List<Reply> queryReplyByTime(Date time,Page page) throws Exception;
	
	/**
	 * 查询回答里的所有记录条数
	 * @return
	 * @throws Exception
	 */
	public int queryReplyAll() throws Exception;
	
	/**
	 * 根据客服ID查找回答条数
	 * @param sid
	 * @return
	 * @throws Exception
	 */
	public int queryReplyCountBySid(int sid) throws Exception;
	
	/**
	 * 根据用户查询回答内容
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public List<Reply> queryReplyRecordByName(String user) throws Exception;
	
	public List<Reply> queryReplyRecordByName_date(String user,String date) throws Exception;
}
